package com.dartfar.workflow.model;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.CascadeType;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;

/**
 * 流程定义表
 * @author 王琦
 * 
 */

@Entity
@Table(name = "T_WorkflowDeployment")
public class WorkflowDeployment {
	
	//主键
	private int id;
	//流程定义ID
	private String processDefinitionId;
	//部署ID
	private String deployId;
	//文件路径
	private String filePath;
	//文件名称
	private String fileName;
	//流程名称
	private String processName;
	//流程键
	private String processKey;
	//流程版本号
	private Long version;
	//流程描述
	private String descript;
	//流程任务节点
	private List<WorkflowDeployTask> workflowDeployTasks;
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getDeployId() {
		return deployId;
	}
	public void setDeployId(String deployId) {
		this.deployId = deployId;
	}
	public String getFilePath() {
		return filePath;
	}
	public void setFilePath(String filePath) {
		this.filePath = filePath;
	}
	public String getFileName() {
		return fileName;
	}
	public void setFileName(String fileName) {
		this.fileName = fileName;
	}
	public String getProcessName() {
		return processName;
	}
	public void setProcessName(String processName) {
		this.processName = processName;
	}
	public String getProcessKey() {
		return processKey;
	}
	public void setProcessKey(String processKey) {
		this.processKey = processKey;
	}
	public String getDescript() {
		return descript;
	}
	public void setDescript(String descript) {
		this.descript = descript;
	}
	
	@OneToMany(fetch = FetchType.LAZY, cascade = {CascadeType.ALL}, mappedBy = "workflowDeployment")
	@LazyCollection(LazyCollectionOption.TRUE)
	public List<WorkflowDeployTask> getWorkflowDeployTasks() {
		return workflowDeployTasks;
	}
	public void setWorkflowDeployTasks(List<WorkflowDeployTask> workflowDeployTasks) {
		this.workflowDeployTasks = workflowDeployTasks;
	}
	public String getProcessDefinitionId() {
		return processDefinitionId;
	}
	public void setProcessDefinitionId(String processDefinitionId) {
		this.processDefinitionId = processDefinitionId;
	}
	public Long getVersion() {
		return version;
	}
	public void setVersion(Long version) {
		this.version = version;
	}


}
